package com.wenlin.myproduction.bean;

import android.os.Parcel;
import android.os.Parcelable;

public class LabelBean implements Parcelable {
    private int id;
    private String name;
    private String colour;
    private int nums;//评价次数
    private float startX;
    private float startY;
    private float width;
    private float height;
    private boolean selected;//是否被选中
    private float animFactor;//动画因子，实际是选中时向四周移动的距离
    private float oldAnimFactor;//旧的动画因子

    public LabelBean() {
    }

    public LabelBean(int id, String name, String colour) {
        this.id = id;
        this.name = name;
        this.colour = colour;
    }

    public float getOldAnimFactor() {
        return oldAnimFactor;
    }

    public void setOldAnimFactor(float oldAnimFactor) {
        this.oldAnimFactor = oldAnimFactor;
    }

    public float getAnimFactor() {
        return animFactor;
    }

    public void setAnimFactor(float animFactor) {
        this.animFactor = animFactor;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColour() {
        return colour;
    }

    public void setColour(String colour) {
        this.colour = colour;
    }

    public int getNums() {
        return nums;
    }

    public void setNums(int nums) {
        this.nums = nums;
    }

    public float getStartX() {
        return startX;
    }

    public void setStartX(float startX) {
        this.startX = startX;
    }

    public float getStartY() {
        return startY;
    }

    public void setStartY(float startY) {
        this.startY = startY;
    }

    public float getWidth() {
        return width;
    }

    public void setWidth(float width) {
        this.width = width;
    }

    public float getHeight() {
        return height;
    }

    public void setHeight(float height) {
        this.height = height;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.name);
        dest.writeString(this.colour);
        dest.writeInt(this.nums);
        dest.writeFloat(this.startX);
        dest.writeFloat(this.startY);
        dest.writeFloat(this.width);
        dest.writeFloat(this.height);
        dest.writeByte(this.selected ? (byte) 1 : (byte) 0);
    }

    public void readFromParcel(Parcel source) {
        this.id = source.readInt();
        this.name = source.readString();
        this.colour = source.readString();
        this.nums = source.readInt();
        this.startX = source.readFloat();
        this.startY = source.readFloat();
        this.width = source.readFloat();
        this.height = source.readFloat();
        this.selected = source.readByte() != 0;
    }

    protected LabelBean(Parcel in) {
        this.id = in.readInt();
        this.name = in.readString();
        this.colour = in.readString();
        this.nums = in.readInt();
        this.startX = in.readFloat();
        this.startY = in.readFloat();
        this.width = in.readFloat();
        this.height = in.readFloat();
        this.selected = in.readByte() != 0;
    }

    public static final Creator<LabelBean> CREATOR = new Creator<LabelBean>() {
        @Override
        public LabelBean createFromParcel(Parcel source) {
            return new LabelBean(source);
        }

        @Override
        public LabelBean[] newArray(int size) {
            return new LabelBean[size];
        }
    };
}
